package com.tul.exercise.base.innerclass;

/**
 * 10.1 创建内部类
 *
 * Created by 第五天 on 2018/7/29.
 */
public class Outer {

    private String name;
    public Outer(String name) {
        this.name = name;
    }

    class Inner{
        private String name;

        public Inner(String name) {
            this.name = name;
        }

    }

    public Inner getInner(String name) {
        return  new Inner(name);
    }


    public class PublicInnter{
        private String name;

        public PublicInnter(String name) {
            this.name = name;
        }
    }

    public static void main(String[] args) {
        Outer outer = new Outer("外部类");

        //
        //Inner inner1 = new Inner("内部类");

        Inner inner2 = outer.getInner("内部类");

    }


}
